

wifi.eventmon.register(wifi.eventmon.STA_CONNECTED, function(T)
    print("STA_CONNECTED  SSID="..T.SSID)
    print("STA_CONNECTED  BSSID="..T.BSSID)
    print("STA_CONNECTED  channel="..T.channel)
 end)

wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, function(T)
    print("STA_DISCONNECTED  SSID="..T.SSID)
    print("STA_DISCONNECTED  BSSID="..T.BSSID)
    print("STA_DISCONNECTED  reason="..T.reason)
 end)

wifi.eventmon.register(wifi.eventmon.STA_GOT_IP, function(T)
    print("get_ip ip="..T.IP)
    print("get_ip netmask="..T.netmask)
    print("get_ip gateway="..T.gateway)
 end)

wifi.setmode(wifi.STATION)
wifi.sta.config('A701', 'a15880287827')